var express = require('express');
var cityController = require('../controllers/cityController')
var fs = require('fs')
var router = express.Router();

/* GET home page. */
router.get('/', cityController.cityFind);

router.get(`/img`,(req,res,next)=>{
    fs.readFile(`public/images/${req.query.img}`,'binary',(err,data)=>{
        if(err){
            console.log(err)
            return
        }else{
            res.write(data,'binary')
            res.end()
        }
    })
})

module.exports = router;
